<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><div id="top_out">
	<div class="out">
		<div class="top_ad center">
			<a href="">
				<img src="http://localhost/gks/1113/shop/HSHOP/Index/View/Index/img/top_ad.jpg" />
			</a>
		</div>
	</div>
	<div class="out_down">
		<div class="top center">
			<ul class="fl">
				<li><a href="javascript:;">邀请好友</a> |
				</li>
				<li><a href="javascript:;" onclick="shoucang(document.title,window.location)">加入收藏</a>
				</li>
			</ul>
			<ul class="fr">
				
				<?php if($_SESSION['user']['uid']){?>
					<li>
						<span class="hello">您好，</span><a href="javascript"><?php echo $_SESSION['user']['username'];?></a>
					</li>
					<li>
						<a href="<?php echo U('Login/out');?>">[退出]</a>
					</li>
				<?php  }else{ ?>
				<li>
					<span class="hello">您好，欢迎来到珍品网！</span>
				</li>
				<li>
					<a href="<?php echo U('Login/login');?>">[ 登录 ]</a>
				</li>
				<li>
					<a href="<?php echo U('Login/reg');?>">[ 免费注册 ]</a> |
				</li>
				<?php }?>
				<li>
					<a href="<?php echo U('member');?>">我的订单</a> |
				</li>
				<li id="shop">
					<a href="<?php echo U('Cart/index');?>" class="shop">购物车<span class="count" id="totalNum"><?php if($_SESSION['cart']['totalNum']){?><?php echo $_SESSION['cart']['totalNum'];?><?php  }else{ ?>0<?php }?></span>件商品</a>
					<div class="second">
						<?php if($_SESSION['cart']['totalNum']){?>
							<ul>
								<li><h3>最新加入的商品</h3></li>
								<?php $hd["list"]["c"]["total"]=0;if(isset($_SESSION['cart']['goods']) && !empty($_SESSION['cart']['goods'])):$_id_c=0;$_index_c=0;$lastc=min(1000,count($_SESSION['cart']['goods']));
$hd["list"]["c"]["first"]=true;
$hd["list"]["c"]["last"]=false;
$_total_c=ceil($lastc/1);$hd["list"]["c"]["total"]=$_total_c;
$_data_c = array_slice($_SESSION['cart']['goods'],0,$lastc);
if(count($_data_c)==0):echo "";
else:
foreach($_data_c as $key=>$c):
if(($_id_c)%1==0):$_id_c++;else:$_id_c++;continue;endif;
$hd["list"]["c"]["index"]=++$_index_c;
if($_index_c>=$_total_c):$hd["list"]["c"]["last"]=true;endif;?>

									<li id="<?php echo $c['cart_id'];?>">
										<img src="http://localhost/gks/1113/shop/<?php echo $c['img'];?>" alt="" />
										<a href="<?php echo U('Index/content',array('gid'=>$c['gid']));?>" class="goods_name"><?php echo $c['goods_name'];?> <?php echo $c['attr_value'];?></a>
										<span class="price">￥ <?php echo $c['price'];?></span>
										<span class="num"> x <?php echo $c['num'];?></span>
										<a href="javascript:;" class="del" onclick="delGoods('<?php echo $c['cart_id'];?>')">删除</a>
									</li>
								<?php $hd["list"]["c"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
								<li class="account">
									<p>
										共<span class="num" id="goodsNum"><?php echo $_SESSION['cart']['totalNum'];?></span>件商品&nbsp;&nbsp;&nbsp;&nbsp;
										共计<span class="price" >￥<font style="font-size: 21px;"id="goodsPrice"><?php echo $_SESSION['cart']['totalPrice'];?></font></span>
									</p>
									<a href="<?php echo U('Cart/index');?>" class="continue">去购物车结算></a>
								</li>
							</ul>
						<?php  }else{ ?>
							<div class="null">购物车内还没有商品，赶紧选购吧！</div>
						<?php }?>
						
					</div>
				</li>
			</ul>
		</div>
	</div>
</div>
<div id="search" class="center">
	<div class="left fl">
		<a href="<?php echo U('index');?>" class="logo">
			<img src="http://localhost/gks/1113/shop/HSHOP/Index/View/Index/img/logo.jpg" alt="" />
		</a>
	</div>
	<div class="middle fl">
		<form action="" method="get">
			<input type="text" name="keywords" value="UGG" class="fl" onclick="this.value='';" onblur="this.value='UGG'" />
			<input type="submit" value="搜索" class="fl" />
		</form>
	</div>
	<div class="right fr">

	</div>
</div>
<div id="nav_out">
	<div class="nav center">
		<div class="all_goods">
			<a href="" class="menu">全部商品分类</a>
			<div class="second" >
				<div class="sec_menu">
					<dl class="dl">
						<dt><i></i><a href="">品牌</a><b></b></dt>
						<dd>
							<?php $hd["list"]["b"]["total"]=0;if(isset($brand) && !empty($brand)):$_id_b=0;$_index_b=0;$lastb=min(3,count($brand));
$hd["list"]["b"]["first"]=true;
$hd["list"]["b"]["last"]=false;
$_total_b=ceil($lastb/1);$hd["list"]["b"]["total"]=$_total_b;
$_data_b = array_slice($brand,0,$lastb);
if(count($_data_b)==0):echo "";
else:
foreach($_data_b as $key=>$b):
if(($_id_b)%1==0):$_id_b++;else:$_id_b++;continue;endif;
$hd["list"]["b"]["index"]=++$_index_b;
if($_index_b>=$_total_b):$hd["list"]["b"]["last"]=true;endif;?>

								<a href="<?php echo U('Index/brand',array('bid'=>$b['brand_id']));?>"><?php echo $b['brand_name'];?></a>
							<?php $hd["list"]["b"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
						</dd>
					</dl>
					<div class="second_list">
						<ul>
							<?php $hd["list"]["b"]["total"]=0;if(isset($brand) && !empty($brand)):$_id_b=0;$_index_b=0;$lastb=min(11,count($brand));
$hd["list"]["b"]["first"]=true;
$hd["list"]["b"]["last"]=false;
$_total_b=ceil($lastb/1);$hd["list"]["b"]["total"]=$_total_b;
$_data_b = array_slice($brand,0,$lastb);
if(count($_data_b)==0):echo "";
else:
foreach($_data_b as $key=>$b):
if(($_id_b)%1==0):$_id_b++;else:$_id_b++;continue;endif;
$hd["list"]["b"]["index"]=++$_index_b;
if($_index_b>=$_total_b):$hd["list"]["b"]["last"]=true;endif;?>

								<li><a href="<?php echo U('Index/brand',array('bid'=>$b['brand_id']));?>"><img src="http://localhost/gks/1113/shop/<?php echo $b['brand_logo'];?>" alt="<?php echo $b['brand_name'];?>" /></a></li>
							<?php $hd["list"]["b"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
							<li><a href="<?php echo U('Index/brand');?>"><img src="http://localhost/gks/1113/shop/HSHOP/Index/View/Index/img/brand/24.png" alt=""></a></li>
						</ul>
					</div>
				</div>
				<?php $hd["list"]["c1"]["total"]=0;if(isset($category) && !empty($category)):$_id_c1=0;$_index_c1=0;$lastc1=min(1000,count($category));
$hd["list"]["c1"]["first"]=true;
$hd["list"]["c1"]["last"]=false;
$_total_c1=ceil($lastc1/1);$hd["list"]["c1"]["total"]=$_total_c1;
$_data_c1 = array_slice($category,0,$lastc1);
if(count($_data_c1)==0):echo "";
else:
foreach($_data_c1 as $key=>$c1):
if(($_id_c1)%1==0):$_id_c1++;else:$_id_c1++;continue;endif;
$hd["list"]["c1"]["index"]=++$_index_c1;
if($_index_c1>=$_total_c1):$hd["list"]["c1"]["last"]=true;endif;?>

					<div class="sec_menu">
						<dl class="dl">
							<dt><i></i><a href="<?php echo U('Index/Index/category',array('cid'=>$c1['cid']));?>"><?php echo $c1['cat_name'];?></a><b></b></dt>
							<dd>
								<?php $hd["list"]["c2"]["total"]=0;if(isset($c1['_data']) && !empty($c1['_data'])):$_id_c2=0;$_index_c2=0;$lastc2=min(3,count($c1['_data']));
$hd["list"]["c2"]["first"]=true;
$hd["list"]["c2"]["last"]=false;
$_total_c2=ceil($lastc2/1);$hd["list"]["c2"]["total"]=$_total_c2;
$_data_c2 = array_slice($c1['_data'],0,$lastc2);
if(count($_data_c2)==0):echo "";
else:
foreach($_data_c2 as $key=>$c2):
if(($_id_c2)%1==0):$_id_c2++;else:$_id_c2++;continue;endif;
$hd["list"]["c2"]["index"]=++$_index_c2;
if($_index_c2>=$_total_c2):$hd["list"]["c2"]["last"]=true;endif;?>

									<?php $hd["list"]["c3"]["total"]=0;if(isset($c2['_data']) && !empty($c2['_data'])):$_id_c3=0;$_index_c3=0;$lastc3=min(3,count($c2['_data']));
$hd["list"]["c3"]["first"]=true;
$hd["list"]["c3"]["last"]=false;
$_total_c3=ceil($lastc3/1);$hd["list"]["c3"]["total"]=$_total_c3;
$_data_c3 = array_slice($c2['_data'],0,$lastc3);
if(count($_data_c3)==0):echo "";
else:
foreach($_data_c3 as $key=>$c3):
if(($_id_c3)%1==0):$_id_c3++;else:$_id_c3++;continue;endif;
$hd["list"]["c3"]["index"]=++$_index_c3;
if($_index_c3>=$_total_c3):$hd["list"]["c3"]["last"]=true;endif;?>

									<a href="<?php echo U('Index/Index/category',array('cid'=>$c3['cid']));?>"><?php echo $c3['cat_name'];?></a>
									<?php $hd["list"]["c1"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
								<?php $hd["list"]["c2"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
							</dd>
						</dl>
						<div class="second_list">
							<?php $hd["list"]["c3"]["total"]=0;if(isset($c1['_data']) && !empty($c1['_data'])):$_id_c3=0;$_index_c3=0;$lastc3=min(1000,count($c1['_data']));
$hd["list"]["c3"]["first"]=true;
$hd["list"]["c3"]["last"]=false;
$_total_c3=ceil($lastc3/1);$hd["list"]["c3"]["total"]=$_total_c3;
$_data_c3 = array_slice($c1['_data'],0,$lastc3);
if(count($_data_c3)==0):echo "";
else:
foreach($_data_c3 as $key=>$c3):
if(($_id_c3)%1==0):$_id_c3++;else:$_id_c3++;continue;endif;
$hd["list"]["c3"]["index"]=++$_index_c3;
if($_index_c3>=$_total_c3):$hd["list"]["c3"]["last"]=true;endif;?>

								<dl>
									<dt><a href="<?php echo U('Index/Index/category',array('cid'=>$c3['cid']));?>"><?php echo $c3['cat_name'];?></a></dt>
									<dd>
										<?php $hd["list"]["c4"]["total"]=0;if(isset($c3['_data']) && !empty($c3['_data'])):$_id_c4=0;$_index_c4=0;$lastc4=min(1000,count($c3['_data']));
$hd["list"]["c4"]["first"]=true;
$hd["list"]["c4"]["last"]=false;
$_total_c4=ceil($lastc4/1);$hd["list"]["c4"]["total"]=$_total_c4;
$_data_c4 = array_slice($c3['_data'],0,$lastc4);
if(count($_data_c4)==0):echo "";
else:
foreach($_data_c4 as $key=>$c4):
if(($_id_c4)%1==0):$_id_c4++;else:$_id_c4++;continue;endif;
$hd["list"]["c4"]["index"]=++$_index_c4;
if($_index_c4>=$_total_c4):$hd["list"]["c4"]["last"]=true;endif;?>

											<a href="<?php echo U('Index/Index/category',array('cid'=>$c4['cid']));?>"><?php echo $c4['cat_name'];?></a>
										<?php $hd["list"]["c3"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
									</dd>
								</dl>
							<?php $hd["list"]["c4"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
							<div class="quick"><a href="<?php echo U('Index/Index/category',array('cid'=>$c1['cid']));?>">进入<?php echo $c1['cat_name'];?>频道页>></a></div>
						</div>
					</div>
				<?php $hd["list"]["c3"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
			</div>
		</div>
		<ul class="middle fl">
			<li><a href="<?php echo U('index');?>" class="cur">首页</a>
			</li>
			<li><a href="">品牌旗舰店</a>
			</li>
			<li><a href="">最新上架</a>
			</li>
			<li><a href="">奢侈品特卖</a>
			</li>
			<li><a href="">礼品卡</a>
			</li>
		</ul>
	</div>
</div>